home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / Xpm / pixmap / Requests.h < prev    next >
Text File  |  1994-08-01  |  6KB  |  162 lines

  1. /* * Last edited: Sep 12 16:59 1991 (mallet) */
  2. /*
  3.  * $Id: Requests.h,v 1.4.1.1 1992/08/05 15:26:04 mallet Exp $
  4.  * 
  5.  * Copyright 1991 Lionel Mallet
  6.  * 
  7.  * Permission to use, copy, modify, distribute, and sell this software and its
  8.  * documentation for any purpose is hereby granted without fee, provided that
  9.  * the above copyright notice appears in all copies and that both that
  10.  * copyright notice and this permission notice appear in supporting
  11.  * documentation, and that the name of Lionel MALLET not be used in
  12.  * advertising or publicity pertaining to distribution of the software
  13.  * without specific, written prior permission.  Lionel MALLET makes no
  14.  * representations about the suitability of this software for any
  15.  * purpose.  It is provided "as is" without express or implied warranty.
  16.  *
  17.  * Lionel MALLET DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
  18.  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
  19.  * FITNESS, IN NO EVENT SHALL Lionel MALLET BE LIABLE FOR ANY SPECIAL,
  20.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  21.  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 
  22.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  23.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  *
  25.  *  This software is opened and free. Furthermore, everybody is kindly
  26.  * invited to participate to improve it for the benefit of all.
  27.  * Improvements can be new features, bugs fixes and porting issues
  28.  * resolution.
  29.  *
  30.  * Author:  Lionel Mallet, SIMULOG
  31.  */
  32.  
  33. /*
  34.  * $XConsortium: Requests.h,v 1.2 90/06/09 20:20:44 dmatic Exp $
  35.  *
  36.  * Copyright 1989 Massachusetts Institute of Technology
  37.  *
  38.  * Permission to use, copy, modify, distribute, and sell this software and its
  39.  * documentation for any purpose is hereby granted without fee, provided that
  40.  * the above copyright notice appear in all copies and that both that
  41.  * copyright notice and this permission notice appear in supporting
  42.  * documentation, and that the name of M.I.T. not be used in advertising or
  43.  * publicity pertaining to distribution of the software without specific,
  44.  * written prior permission.  M.I.T. makes no representations about the
  45.  * suitability of this software for any purpose.  It is provided "as is"
  46.  * without express or implied warranty.
  47.  *
  48.  * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  49.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
  50.  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  51.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  52.  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  53.  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  54.  *
  55.  * Author:  Davor Matic, MIT X Consortium
  56.  */
  57.  
  58.  
  59.  
  60. typedef struct {
  61.     Boolean  success;
  62.     Position at_x, at_y;
  63.     Position from_x, from_y,
  64.              to_x, to_y;
  65.     void   (*draw)();
  66.     Pixel    value;
  67.     Time     time;
  68.     int      state;
  69. } PWStatus;
  70.  
  71. void OnePointEngage();
  72. void OnePointTerminate();
  73. void OnePointTerminateTransparent();
  74. void DragOnePointEngage();
  75. void DragOnePointTerminate();
  76. void TwoPointsEngage();
  77. void TwoPointsTerminate();
  78. void TwoPointsTerminateTransparent();
  79. void TwoPointsTerminateTimed();
  80. void DragTwoPointsEngage();
  81. void DragTwoPointsTerminate();
  82. void Interface();
  83. void Paste();
  84.  
  85. static PWRequestRec requests[] =
  86. {
  87. {MarkRequest, sizeof(PWStatus),
  88.      TwoPointsEngage, (XtPointer) PWDrawRectangle,
  89.      TwoPointsTerminateTimed, (XtPointer) PWSelect,
  90.      NULL, (XtPointer) NULL},
  91. {RestoreRequest, sizeof(PWStatus),
  92.      OnePointEngage, (XtPointer) PWDragStored,
  93.      OnePointTerminate, (XtPointer) PWRestore,
  94.      NULL, (XtPointer) NULL},
  95. {ImmediateCopyRequest, sizeof(PWStatus),
  96.      OnePointEngage, (XtPointer) PWDragMarked,
  97.      OnePointTerminate, (XtPointer) PWCopy,
  98.      NULL, (XtPointer) NULL},
  99. {ImmediateMoveRequest, sizeof(PWStatus),
  100.      OnePointEngage, (XtPointer) PWDragMarked,
  101.      OnePointTerminate, (XtPointer) PWMove,
  102.      NULL, (XtPointer) NULL},
  103. {CopyRequest, sizeof(PWStatus),
  104.      DragOnePointEngage, (XtPointer) Paste,
  105.      DragOnePointTerminate, (XtPointer) ImmediateCopyRequest,
  106.      Interface, (XtPointer) PWUnmark},
  107. {MoveRequest, sizeof(PWStatus),
  108.      DragOnePointEngage, (XtPointer) Paste,
  109.      DragOnePointTerminate, (XtPointer) ImmediateMoveRequest,
  110.      Interface, (XtPointer) PWUnmark},
  111. {PointRequest, sizeof(PWStatus),
  112.      DragOnePointEngage, (XtPointer) PWDrawPoint,
  113.      DragOnePointTerminate, (XtPointer) PWDrawPoint,
  114.      NULL, (XtPointer) NULL},
  115. {CurveRequest, sizeof(PWStatus),
  116.      DragTwoPointsEngage, (XtPointer) PWBlindLine,
  117.      DragTwoPointsTerminate, (XtPointer) PWBlindLine,
  118.      NULL, (XtPointer) NULL},
  119. {LineRequest, sizeof(PWStatus), 
  120.      TwoPointsEngage, (XtPointer) PWDrawLine, 
  121.      TwoPointsTerminate, (XtPointer) PWDrawLine,
  122.      NULL, (XtPointer) NULL},
  123. {RectangleRequest, sizeof(PWStatus), 
  124.      TwoPointsEngage, (XtPointer) PWDrawRectangle,
  125.      TwoPointsTerminate, (XtPointer) PWDrawRectangle,
  126.      NULL, (XtPointer) NULL},
  127. {FilledRectangleRequest, sizeof(PWStatus), 
  128.      TwoPointsEngage, (XtPointer) PWDrawRectangle,
  129.      TwoPointsTerminate, (XtPointer) PWDrawFilledRectangle,
  130.      NULL, (XtPointer) NULL},
  131. {CircleRequest, sizeof(PWStatus), 
  132.      TwoPointsEngage, (XtPointer) PWDrawCircle,
  133.      TwoPointsTerminate, (XtPointer) PWDrawCircle,
  134.      NULL, (XtPointer) NULL},
  135. {FilledCircleRequest, sizeof(PWStatus), 
  136.      TwoPointsEngage, (XtPointer) PWDrawCircle, 
  137.      TwoPointsTerminate, (XtPointer) PWDrawFilledCircle,
  138.      NULL, (XtPointer) NULL},
  139. {FloodFillRequest, sizeof(PWStatus),
  140.      OnePointEngage, (XtPointer) NULL,
  141.      OnePointTerminate, (XtPointer) PWFloodFill,
  142.      NULL, (XtPointer) NULL},
  143. {HotSpotRequest, sizeof(PWStatus),
  144.      OnePointEngage, (XtPointer) PWDrawHotSpot,
  145.      OnePointTerminate, (XtPointer) PWDrawHotSpot,
  146.      NULL, (XtPointer) NULL},
  147. {PickPixelRequest, sizeof(PWStatus),
  148.      OnePointEngage,    (XtPointer) PWPickPixelDraw,
  149.      OnePointTerminate, (XtPointer) PWPickPixelComplete,
  150.      NULL, (XtPointer) NULL},
  151. {ZoomInRequest, sizeof(PWStatus),
  152.      TwoPointsEngage, (XtPointer) PWDrawRectangle,
  153.      TwoPointsTerminate, (XtPointer) PWZoomIn,
  154.      NULL, (XtPointer) NULL},
  155. {TextRequest, sizeof(PWStatus),
  156.      OnePointEngage,    (XtPointer) PWDragText,
  157.      OnePointTerminate, (XtPointer) PWDrawText,
  158.      NULL, (XtPointer) NULL},
  159. };
  160.  
  161.  
  162.